package org.example.service.impl;

import org.example.Mapper.LastArticleMapper;
import org.example.domain.LastArticle;
import org.example.service.LastArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LastArticleServiceImpl implements LastArticleService {

    @Autowired
    private LastArticleMapper lastArticleMapper;

    @Override
    public void addLastArticle(LastArticle lastArticle) {
        lastArticleMapper.addLastArticle(lastArticle.getArticleLink(),lastArticle.getTitle(),
                lastArticle.getPictureLink(),lastArticle.getDate());
    }

    @Override
    public LastArticle[] getLastArticleLimit(Integer start, Integer number) {
        return lastArticleMapper.getLastArticleLimit(start,number);
    }
}
